<template>
  <div class="personal-center-container">
    <div class="container">
      <div class="info">
        <img src="../assets/default-avatar.png" alt="">
        <div class="right">
          <div class="nickname">ishuhao12138</div>
          <!-- 成长值 -->
          <div class="level">
            <div class="title">
              <span>成长值</span>
              <span>0/1</span>
            </div>
            <!-- 进度条 -->
            <div class="bar">
              <div class="progress" :style="{width: `${(current / total) * 100}%`}"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="rights">
        <div class="item" v-for="right in rights" :key="right.id">
          <div class="label">{{ right.title }}</div>
          <div class="content">{{ right.unit === 'money' ? $t('priceSymbol') : '' }}{{ right.count }}{{ right.unit === 'money' ? '' : right.unit }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      total: 100,
      current: 10,
      rights: [
        { id: 'redPackage', title: '我的红包', count: 0, unit: 'money' },
        { id: 'feedbackMoney', title: '回馈金', count: 0, unit: 'money' },
        { id: 'coupon', title: '优惠券', count: 0, unit: '张' },
        { id: 'integral', title: '我的积分', count: 0, unit: '' },
        { id: 'giftCard', title: '礼品卡', count: 0, unit: 'money' }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
@import "../styles/variable.less";

.personal-center-container {
  .container {
    background-repeat: no-repeat;
    background-image: url("../assets/personal.png");
    background-size: cover;
    border: 1px solid @line-color-light2;
    display: flex !important;
    padding: 40px 0px;
    height: 200px;
    .info {
      align-items: center;
      border-right: 1px dashed rgba(180, 160, 120, .38);
      display: flex;
      flex: 2;
      padding: 0px 50px;
      img {
        border-radius: 38px;
        width: 76px;
        height: 76px;
      }
      .right {
        padding-left: 20px;
        width: 100%;
        .nickname {
          flex: 1;
          font-size: 14px;
          max-width: 150px;
        }
        .level {
          margin-top: 16px;
          .title {
            display: flex;
            font-size: 14px;
            justify-content: space-between;
            margin-bottom: 6px;
          }
          .bar {
            background-color: @write;
            border-radius: 4px;
            width: 100%;
            height: 8px;
            overflow: hidden;
            .progress {
              background-color: #BEA988;
              width: 0%;
              height: 100%;
              transition: all 0.3s ease;
            }
          }
        }
      }
    }
    .rights {
      flex: 3;
      padding: 0px 50px;
      overflow: hidden;
      .item {
        float: left;
        font-size: 14px;
        width: 210px;
        margin-bottom: 30px;
        overflow: hidden;
        .label {
          float: left;
          width: 56px;
          margin-right: 20px;
          text-align: left;
        }
        .content {
          float: left;
        }
      }
    }
  }
}
</style>
